# -*- coding: utf-8 -*-
'''
@author: Hugo
@file: Bloom库的使用.py
@time: 2021/8/21 20:05
'''
import time

import icecream
from bloom_filter import BloomFilter

# 生成一个亿大小的空间
ff = BloomFilter(max_elements=100000000,
                 error_rate=0.1)
for i in range(5):

    ff.add('http://www.baidu123.com')

    icecream.ic(ff.__contains__('http://www.baidu1234.com'))

    ff.add('http://www.baidu1234.com')

    icecream.ic(ff.__contains__('http://www.baidu123.com'))






